Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

507 add cross border flows to scenarios #522

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tiernan-buckley-ufr
Copy link
Collaborator

Pull Request

Related Issue

Closes #507

Description

This update adds a new type of unit, "Exchanges", corresponding to the commercial exchanges (imports/exports), allowing imports and exports to be added to the market dynamics.

Exports are treated as a form of demand and are set as a bid just below the (price-inelastic) demand bid price to ensure they are realised, and imports are treated as a form of generation set near to the min. bid price to ensure they are realised.

In example 1a, an "exchanges_df.csv" is added to the inputs containing import and export values that are fractions of the demand_df values. A corresponding "exchanges_units.csv" is made configuring how the exchanges participate in the market.

In example 3, "exchanges_df.csv" contains German commercial exchanges for the year 2019, and "exchanges_units.csv" configures how the exchanges participate in the market.

Changes Proposed

  • Create new unit type "Exchanges", to allow imports and exports to participate in the market.
  • Add exchanges data to examples 1a and 3.
  • Make ramp variables optional in Unit class declarations.

Testing

  • For example 3, the accepted bid prices with and without exchanges were modelled and compared with historical prices for 2019 to see if including exchanges improves the accuracy of the model.

  • For January:

    • Modelled Average without Exchanges: 32.60
    • Modelled Average with Exchanges: 37.80
    • Actual Average Price: 49.40
  • For April:

    • Modelled Average without Exchanges: 29.50
    • Modelled Average with Exchanges: 31.70
    • Actual Average Price: 36.96
  • For July:

    • Modelled Average without Exchanges: 31.30
    • Modelled Average with Exchanges: 30.70
    • Actual Average Price: 39.68

For January a significant increase in accuracy is seen, for April a marginal increase, and for July a slight decrease is seen.

Checklist

Please check all applicable items:

  • Code changes are sufficiently documented (docstrings, inline comments, doc folder updates)
  • New unit tests added for new features or bug fixes
  • Existing tests pass with the changes
  • Reinforcement learning examples are operational (for DRL-related changes)
  • Code tested with both local and Docker databases
  • Code follows project style guidelines and best practices
  • [] Changes are backwards compatible, or deprecation notices added
  • New dependencies added to pyproject.toml
  • A note for the release notes doc/release_notes.rst of the upcoming release is included
  • Consent to release this PR's code under the GNU Affero General Public License v3.0

@tiernan-buckley-ufr tiernan-buckley-ufr linked an issue Dec 12, 2024 that may be closed by this pull request
@nick-harder
Copy link
Member

@tiernan-buckley-ufr in the future run the pre-commit run --all-files command as described in the development section of the readme file to avoid errors during checks

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 56.52174% with 20 lines in your changes missing coverage. Please review.

Project coverage is 77.39%. Comparing base (27f6365) to head (cff2eb5).

Files with missing lines Patch % Lines
assume/units/exchanges.py 37.93% 18 Missing ⚠️
assume/common/base.py 87.50% 1 Missing ⚠️
assume/scenario/loader_csv.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #522      +/-   ##
==========================================
- Coverage   77.52%   77.39%   -0.14%     
==========================================
  Files          50       51       +1     
  Lines        6790     6830      +40     
==========================================
+ Hits         5264     5286      +22     
- Misses       1526     1544      +18     
Flag Coverage Δ
pytest 77.39% <56.52%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cross-border flows to scenarios
3 participants